<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    907. Koko Eating Bananas
   </h1>
   <p>
    Koko loves to eat bananas.&nbsp; There are
    <code>
     N
    </code>
    &nbsp;piles of bananas, the
    <code>
     i
    </code>
    -th&nbsp;pile has
    <code>
     piles[i]
    </code>
    bananas.&nbsp; The guards have gone and will come back in
    <code>
     H
    </code>
    hours.
   </p>
   <p>
    Koko can decide her bananas-per-hour eating speed of
    <code>
     K
    </code>
    .&nbsp; Each hour, she chooses some pile of bananas, and eats K bananas from that pile.&nbsp; If the pile has less than
    <code>
     K
    </code>
    bananas, she eats all of them instead, and won't eat any more bananas during this hour.
   </p>
   <p>
    Koko likes to eat slowly, but still wants to finish eating all the bananas before the guards come back.
   </p>
   <p>
    Return the minimum integer
    <code>
     K
    </code>
    such that she can eat all the bananas within
    <code>
     H
    </code>
    hours.
   </p>
   <p>
    &nbsp;
   </p>
   <ul>
   </ul>
   <div>
    <p>
     <strong>
      Example 1:
     </strong>
    </p>
    <pre>
<strong>Input: </strong>piles = <span id="example-input-1-1">[3,6,7,11]</span>, H = <span id="example-input-1-2">8</span>
<strong>Output: </strong><span id="example-output-1">4</span>
</pre>
    <div>
     <p>
      <strong>
       Example 2:
      </strong>
     </p>
     <pre>
<strong>Input: </strong>piles = <span id="example-input-2-1">[30,11,23,4,20]</span>, H = <span id="example-input-2-2">5</span>
<strong>Output: </strong><span id="example-output-2">30</span>
</pre>
     <div>
      <p>
       <strong>
        Example 3:
       </strong>
      </p>
      <pre>
<strong>Input: </strong>piles = <span id="example-input-3-1">[30,11,23,4,20]</span>, H = <span id="example-input-3-2">6</span>
<strong>Output: </strong><span id="example-output-3">23</span>
</pre>
      <p>
       &nbsp;
      </p>
      <p>
       <strong>
        Note:
       </strong>
      </p>
      <ul>
       <li>
        <code>
         1 &lt;= piles.length &lt;= 10^4
        </code>
       </li>
       <li>
        <code>
         piles.length &lt;= H &lt;= 10^9
        </code>
       </li>
       <li>
        <code>
         1 &lt;= piles[i] &lt;= 10^9
        </code>
       </li>
      </ul>
     </div>
    </div>
   </div>
  </div>
  <div>
   <h1 class="question_title">
    907. 爱吃香蕉的珂珂
   </h1>
   <p>
    珂珂喜欢吃香蕉。这里有&nbsp;
    <code>
     N
    </code>
    &nbsp;堆香蕉，第
    <code>
     i
    </code>
    堆中有&nbsp;
    <code>
     piles[i]
    </code>
    &nbsp;根香蕉。警卫已经离开了，将在&nbsp;
    <code>
     H
    </code>
    &nbsp;小时后回来。
   </p>
   <p>
    珂珂可以决定她吃香蕉的速度&nbsp;
    <code>
     K
    </code>
    &nbsp;（单位：根/小时）。每个小时，她将会选择一堆香蕉，从中吃掉
    <code>
     K
    </code>
    根。如果这堆香蕉少于
    <code>
     K
    </code>
    根，她将吃掉这堆的所有香蕉，然后这一小时内不会再吃更多的香蕉。&nbsp;&nbsp;
   </p>
   <p>
    珂珂喜欢慢慢吃，但仍然想在警卫回来前吃掉所有的香蕉。
   </p>
   <p>
    返回她可以在
    <code>
     H
    </code>
    小时内吃掉所有香蕉的最小速度
    <code>
     K
    </code>
    （
    <code>
     K
    </code>
    为整数）。
   </p>
   <p>
    &nbsp;
   </p>
   <ul>
   </ul>
   <p>
    <strong>
     示例 1：
    </strong>
   </p>
   <pre><strong>输入: </strong>piles = [3,6,7,11], H = 8
<strong>输出: </strong>4
</pre>
   <p>
    <strong>
     示例&nbsp;2：
    </strong>
   </p>
   <pre><strong>输入: </strong>piles = [30,11,23,4,20], H = 5
<strong>输出: </strong>30
</pre>
   <p>
    <strong>
     示例&nbsp;3：
    </strong>
   </p>
   <pre><strong>输入: </strong>piles = [30,11,23,4,20], H = 6
<strong>输出: </strong>23
</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     提示：
    </strong>
   </p>
   <ul>
    <li>
     <code>
      1 &lt;= piles.length &lt;= 10^4
     </code>
    </li>
    <li>
     <code>
      piles.length &lt;= H &lt;= 10^9
     </code>
    </li>
    <li>
     <code>
      1 &lt;= piles[i] &lt;= 10^9
     </code>
    </li>
   </ul>
  </div>
 </body>
</html>